home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / risc_src.lha / risc_sources / xlib / Xutil.cdecl < prev    next >
Text File  |  1990-05-29  |  7KB  |  242 lines

  1. ; Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  2. ; and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  3. ;
  4. ;                         All Rights Reserved
  5. ;
  6. ; Permission to use, copy, modify, and distribute this software and its 
  7. ; documentation for any purpose and without fee is hereby granted, 
  8. ; provided that the above copyright notice appear in all copies and that
  9. ; both that copyright notice and this permission notice appear in 
  10. ; supporting documentation, and that the names of Digital or MIT not be
  11. ; used in advertising or publicity pertaining to distribution of the
  12. ; software without specific, written prior permission.  
  13. ;
  14. ; DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15. ; ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16. ; DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17. ; ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18. ; WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19. ; ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20. ; SOFTWARE.
  21.  
  22. ;; Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
  23. ;; value (x, y, width, height) was found in the parsed string.
  24.  
  25. (const  NoValue        #x0000)
  26. (const  XValue      #x0001)
  27. (const  YValue        #x0002)
  28. (const  WidthValue      #x0004)
  29. (const  HeightValue      #x0008)
  30. (const  AllValues     #x000F)
  31. (const  XNegative     #x0010)
  32. (const  YNegative     #x0020)
  33.  
  34. (typedef (struct
  35.         (long flags)    ;; marks which fields in this structure are defined 
  36.     (int x) (int y)
  37.     (int width) (int height)
  38.     (int min_width) (int min_height)
  39.     (int max_width) (int max_height)
  40.         (int width_inc) (int height_inc)
  41.     ((struct 
  42.         (int x)    ;; numerator 
  43.         (int y)    ;; denominator 
  44.     ) min_aspect)
  45.     ((struct 
  46.         (int x)    ;; numerator 
  47.         (int y)    ;; denominator 
  48.     ) max_aspect)
  49. ) XSizeHints)
  50.  
  51. (typedef (XSizeHints *) XSizeHintsP)
  52.  
  53. ;; The next block of definitions are for window manager properties that
  54. ;; clients and applications use for communication.
  55.  
  56.  
  57. ;; flags argument in size hints 
  58. (const  USPosition    (expt 2 0)) ;; user specified x, y 
  59. (const  USSize        (expt 2 1)) ;; user specified width, height 
  60.  
  61. (const  PPosition    (expt 2 2)) ;; program specified position 
  62. (const  PSize        (expt 2 3)) ;; program specified size 
  63. (const  PMinSize    (expt 2 4)) ;; program specified minimum size 
  64. (const  PMaxSize    (expt 2 5)) ;; program specified maximum size 
  65. (const  PResizeInc    (expt 2 6)) ;; program specified resize increments 
  66. (const  PAspect        (expt 2 7)) ;; program specified min and max aspect ratios 
  67. (const  PAllHints (+ PPosition (+ PSize (+ PMinSize (+ PMaxSize (+ PResizeInc
  68.                                   PAspect))))))
  69.  
  70. (typedef (struct
  71.     (long flags)    ;; marks which fields in this structure are defined 
  72.     (Bool input)    ;; does this application rely on the window manager 
  73.             ;; to get keyboard input? 
  74.     (int initial_state)    ;; see below 
  75.     (Pixmap icon_pixmap)    ;; pixmap to be used as icon 
  76.     (Window icon_window)     ;; window to be used as icon 
  77.     (int icon_x)         ;; initial position of icon
  78.     (int icon_y)
  79.     (Pixmap icon_mask)    ;; icon mask bitmap 
  80.     (XID window_group)    ;; id of related window group 
  81.     ;; this structure may be extended in the future 
  82. ) XWMHints)
  83.  
  84. (typedef (XWMHints *) XWMHintsP)
  85.  
  86. ;; definition for flags of XWMHints 
  87.  
  88. (const  InputHint         (expt 2 0))
  89. (const  StateHint         (expt 2 1))
  90. (const  IconPixmapHint        (expt 2 2))
  91. (const  IconWindowHint        (expt 2 3))
  92. (const  IconPositionHint     (expt 2 4))
  93. (const  IconMaskHint        (expt 2 5))
  94. (const  WindowGroupHint        (expt 2 6))
  95. (const  AllHints (+ InputHint (+ StateHint (+ IconPixmapHint (+ IconWindowHint
  96.         (+ IconPositionHint (+ IconMaskHint WindowGroupHint)))))))
  97.  
  98. ;; definitions for initial window state 
  99.  
  100. (const  DontCareState 0)    ;; don't know or care 
  101. (const  NormalState 1)    ;; most applications want to start this way 
  102. (const  ZoomState 2)    ;; application wants to start zoomed 
  103. (const  IconicState 3)    ;; application wants to start as an icon 
  104. (const  InactiveState 4)    ;; application believes it is seldom used; some
  105.                 ;; wm's may put it on inactive menu 
  106.  
  107.  
  108. (typedef (struct
  109.     (int min_width) (int min_height)
  110.     (int max_width) (int max_height)
  111.     (int width_inc) (int height_inc)
  112. ) XIconSize)
  113.  
  114. (typedef (XIconSize *) XIconSizeP)
  115.  
  116. (typedef (struct
  117.     (charP res_name)
  118.     (charP res_class)
  119. ) XClassHint)
  120.  
  121. (typedef (XClassHint *) XClassHintP)
  122.  
  123. ;; Compose sequence status structure, used in calling XLookupString.
  124.  
  125. (typedef (struct 
  126.     (charP compose_ptr)        ;; state table pointer 
  127.     (int chars_matched)        ;; match state 
  128. ) XComposeStatus)
  129.  
  130. (typedef (XComposeStatus *) XComposeStatusP)
  131.  
  132. ;; opaque reference to Region data type 
  133.  
  134. (typedef (struct) _XRegion)
  135. (typedef (_XRegion *) Region) 
  136.  
  137. ;; Return values from XRectInRegion() 
  138.  
  139. (const  RectangleOut 0)
  140. (const  RectangleIn  1)
  141. (const  RectanglePart 2)
  142.  
  143. ;; Information used by the visual utility routines to find desired visual
  144. ;; type from the many visuals a display may support.
  145.  
  146.  
  147. (typedef (struct
  148.   (VisualP visual)
  149.   (VisualID visualid)
  150.   (int screen)
  151.   (int depth)
  152.   (int class)
  153.   (unsignedlong red_mask)
  154.   (unsignedlong green_mask)
  155.   (unsignedlong blue_mask)
  156.   (int colormap_size)
  157.   (int bits_per_rgb)
  158. ) XVisualInfo)
  159.  
  160. (typedef (XVisualInfo *) XVisualInfoP)
  161.  
  162. (const  VisualNoMask        #x0)
  163. (const  VisualIDMask         #x1)
  164. (const  VisualScreenMask    #x2)
  165. (const  VisualDepthMask        #x4)
  166. (const  VisualClassMask        #x8)
  167. (const  VisualRedMaskMask    #x10)
  168. (const  VisualGreenMaskMask    #x20)
  169. (const  VisualBlueMaskMask    #x40)
  170. (const  VisualColormapSizeMask    #x80)
  171. (const  VisualBitsPerRGBMask    #x100)
  172. (const  VisualAllMask        #x1FF)
  173.  
  174. ;; This defines a window manager property that clients may use to
  175. ;; share standard color maps:
  176.  
  177.  
  178. (typedef (struct
  179.     (Colormap colormap)
  180.     (unsignedlong red_max)
  181.     (unsignedlong red_mult)
  182.     (unsignedlong green_max)
  183.     (unsignedlong green_mult)
  184.     (unsignedlong blue_max)
  185.     (unsignedlong blue_mult)
  186.     (unsignedlong base_pixel)
  187. ) XStandardColormap)
  188.  
  189. (typedef (XStandardColormap *) XStandardColormapP)
  190.  
  191. ;; return codes for XReadBitmapFile and XWriteBitmapFile
  192.  
  193. (const  BitmapSuccess        0)
  194. (const  BitmapOpenFailed     1)
  195. (const  BitmapFileInvalid     2)
  196. (const  BitmapNoMemory        3)
  197.  
  198. ;; Declare the routines that don't return int.
  199.  
  200.  
  201. ;;***************************************************************
  202. ;;
  203. ;; Context Management
  204. ;;
  205. ;;**************************************************************
  206.  
  207.  
  208. ;; Associative lookup table return codes 
  209.  
  210. (const  XCSUCCESS 0)    ;; No error. 
  211. (const  XCNOMEM   1)    ;; Out of memory 
  212. (const  XCNOENT   2)    ;; No entry in table 
  213.  
  214. (typedef int XContext)
  215.  
  216. ;#define XStringToContext(atom)   ((XContext) XrmStringToQuark(atom))
  217.  
  218. ;extern int XUniqueContext();
  219.  
  220. ;extern int XSaveContext(); ;; window, context, data 
  221.     ;; Window       window;        
  222.     ;; XContext    context;        
  223.     ;; caddr_t      data;        
  224.  
  225. ;extern int XFindContext(); ;; display, window, context, data 
  226.     ;; Display        *display;        
  227.     ;; Window       window;        
  228.     ;; XContext    context;        
  229.     ;; caddr_t      *data;       RETURN 
  230.  
  231. ;extern int XDeleteContext(); ;; window, context 
  232.     ;; Window       window;        
  233.     ;; XContext    context;        
  234.  
  235.  
  236. ; XWMHints *XGetWMHints();
  237. ; Region XCreateRegion(), XPolygonRegion();
  238. ; XImage *XCreateImage();
  239.  
  240. ; XVisualInfo *XGetVisualInfo();
  241.  
  242.